`D|D|% Must Have DLL Function Calls System enterBook enterBook reader sizeToPage destination sortlist.dll sortList System initmenus reindex c"Functions" e"Index" e"Add New" e"Reindex" e"Delete..." c"Text" e"Import..." original "Page" && AddNew ("Please "desc,ret,par,ex" " && rf > 0 delete "Do you really want permanently function?" \ f"OK" "Cancel" reindex initmenus Index AddNew enterBook newpage leaveBook enterPage delete enterBook reader initmenus sizeToPage 0 get ShowWindow(hWnd, 3) get ShowWindow(hWnd, 7) end iffffindow(hWnd, 7) end if SetActiveWindow WORD SetActiveWindow(WORD) This User DLL function allows you to activate another window. It is useful when you want to make another ToolBook instance or some other window the active window. The return value is the window handle of the previously active window. The parameter is the handle of the window you want to activate. If you want to show the window of a ToolBook instance, then you use the sysWindowHandle of that instance. If you want to show the window of another program, you will need to use the FindWindow function to get that window's handle. --This example will toggle the window of another ToolBook instance --between minimized and maximized states. When the other window --is maximized, the example will reactivate its ToolBook window. linkDLL user WORD SetActiveWindow(WORD) INT ShowWindow(WORD, INT) INT IsIconic(WORD) end linkDLL getRemote "sysWindowHandle" application ToolBook set hWnd to it if hWnd is null break to system --no ToolBook instance found end if if IsIconic(hWnd) > 0 get ShowWindow(hWnd, 3) get ShowWindow(hWnd, 7) end if get SetActiveWindow(sysWindowHandle) --reactivate this window don't FindWindow WORD FindWindow(STRING, STRING) This User DLL function allows get the window handle of another window. It is a very useful function that is usually used in conjunction with the User DLL function ShowWindow.dow will remain minimized. This function returns the window handle of the specified window. It returns NULL if no such window is found. The first parameter is the class name of the window you are looking for. Generally, you will set this parameter to "" (null), and the FindWindow function will look for any window with the specified caption (see next parameter). The second parameter is the caption of the window you are looking for. For example, "Must Have DLL Function Calls" is the caption of this ToolBook main window. "Program Manager" is the caption of the Program Manager window. --This example finds the Excel window (if Excel is running) and --minimizes it. linkDLL user WORD FindWindow(DWORD,STRING) INT ShowWindow(WORD,INT) end linkDLL set hWnd to FindWindow(0,"Microsoft Excel") if hWnd is 0 request "Excel is not running." break to system end if get ShowWindow(hWnd, 7) --Minimize ExcelllppppppppUptonUppnUpnUpnUpnUpnUpnUpnUpnUp PostMessage INT PostMessage(WORD, WORD, WORD, DWORD) This User DLL function places a message in a window's application queue. The function does not wait for the application to handle the message. This function is most useful to Windows programmers who understand what meaningful and useful messages to post. The function returns a non-zero value if the message was successfully posted. Otherwise, it is zero.the The first parameter is the window handle of the window to receive the message (see FindWindow). The second parameter is the type of message posted (wMsg), the third parameter is wParam, and the fourth parameter is lParam. The specific value of each parameter is dependent on the message being posted. For more information see the Microsoft Windows SDK, Microsoft Press's Windows 3.0 Programmers Reference Manual, or Petzold's Programming Windows. --This example will look for a copy of Paintbrush. If a copy is found, --it will be shut down. linkDLL user WORD findWindow(DWORD, STRING) INT PostMessage(WORD, WORD, WORD, DWORD) end linkDLL get FindWindow(0, "Paintbrush - (Untitled)") if it is not 0 get PostMessage (it, 16, 0, 0) --16 instructs the app to exit end if IsIconic INT IsIconic(WORD) This User DLL function is used to determine if a window is minimized. The function returns a non-zero value if the window is minimized. Otherwise the return value is zero. The single parameter is the handle of the window whose iconic status you are checking. --This example will toggle the window of another ToolBook instance --between minimized and maximized states. linkDLL user INT ShowWindow(WORD, INT) INT IsIconic(WORD) end linkDLL getRemote "sysWindowHandle" application ToolBook set hWnd to it if hWnd is null break to system --no ToolBook instance found end if if IsIconic(hWnd) > 0 get ShowWindow(hWnd, 3) get ShowWindow(hWnd, 7) end if IsIconic FindWindow PostMessage SetActiveWindow ShowWindow `D|D|% Must Have DLL Function Calls System enterBook enterBook reader sizeToPage destination sortlist.dll sortList System --Copyright Asymetrix Corporation, 1990. All Rights Reserved. --Jeff Day, ;Technical Support. initmenus reindex c"Functions" e"Index" e"Add New" e"Reindex" e"Delete..." c"Text" e"Import..." original "Page" && AddNew ("Please "desc,ret,par,ex" " && rf > 0 delete "Do you really want permanently function?" \ f"OK" "Cancel" reindex initmenus Index AddNew enterBook newpage leaveBook enterPage delete enterBook reader initmenus sizeToPage